﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>我的积分 - {config.webname}</title>
<meta content="{config.webkeyword}" name="keywords">
<meta content="{config.webdescription}" name="description">
<link rel="stylesheet" href="{config.webpath}scripts/ui/skins/Aqua/css/ligerui-all.css" />
<link rel="stylesheet" href="{config.webpath}css/pagination.css" />
<link media="screen" type="text/css" href="{config.templateskin}/css/style.css" rel="stylesheet">
<script type="text/javascript" src="{config.webpath}scripts/jquery/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="{config.webpath}scripts/ui/js/ligerBuild.min.js"></script>
<script type="text/javascript" src="{config.templateskin}/js/base.js"></script>
</head>

<body>
<!--Header-->
<%template src=/_header.html/%>
<!--/Header-->

<div class="boxwrap">
  <div class="left180">
    <!--Sidebar-->
    <%template src=/_ucenter_nav.html/%>
    <!--/Sidebar-->
  </div>
  
  <div class="right757">
    <h1 class="main_tit">
      <span><a href="<%linkurl("usercenter","index")%>">管理首页</a></span>
      我的积分
      <strong>Point</strong>
    </h1>
    <%if {action}=="convert"%>
    <!--积分兑换-->
    <div class="tab_head">
      <ul class="tabs">
        <li class="selected"><a href="<%linkurl("userpoint","convert")%>">积分兑换</a></li>
        <li><a href="<%linkurl("userpoint","list")%>">积分明细</a></li>
      </ul>
    </div>
    <h3>目前的账户积分:<b class="red">{userModel.point}</b>分 金额：<b class="red">{userModel.amount}</b>元</h3>
    <%if {uconfig.pointcashrate}==0%>
    <h3>目前的积分兑换功能已被关闭！</h3>
    <%else if {userModel.amount}<1%>
    <h3>目前您的余额不足，不能使用积分兑换功能！</h3>
    <%else%>
    <input id="hideAmount" name="hideAmount" type="hidden" value="{userModel.amount}" />
    <input id="hideCashrate" name="hideCashrate" type="hidden" value="{uconfig.pointcashrate}" />
    <link rel="stylesheet" href="{config.webpath}css/validate.css" />
    <script type="text/javascript" src="{config.webpath}scripts/jquery/jquery.form.js"></script>
    <script type="text/javascript" src="{config.webpath}scripts/jquery/jquery.validate.min.js"></script>
    <script type="text/javascript" src="{config.webpath}scripts/jquery/messages_cn.js"></script>
    <script type="text/javascript">
      $(function(){
        //初始化表单
        AjaxInitForm('point_form', 'btnSubmit', 1, 'turl');
      });
    </script>
    <form id="point_form" name="point_form" url="{config.webpath}tools/submit_ajax.ashx?action=user_point_convert">
    <div class="form_box">
      <dl>
        <dt>兑换说明：</dt>
        <dd>积分兑换最少金额为1元，兑换比例为：1元等于{uconfig.pointcashrate}个积分</dd>
      </dl>
      <dl>
        <dt>积分兑换：</dt>
        <dd><input name="txtAmount" id="txtAmount" type="text" class="input small required" maxlength="50" style="ime-mode:disabled;" onchange="NumConvert(this);" />
        金额转换成 <strong id="convertPoint" class="red" style="font-size:16px;">0</strong> 积分</dd>
      </dl>
      <dl>
        <dt>验证用户密码：</dt>
        <dd><input name="txtPassword" id="txtPassword" type="password" class="input txt required" maxlength="50" /></dd>
      </dl>
      <dl>
        <dt></dt>
        <dd><input name="btnSubmit" id="btnSubmit" type="submit" class="btn_submit" value="确认转换" /></dd>
      </dl>
    </div>
    </form>
    <input id="turl" name="turl" type="hidden" value="<%linkurl("userpoint","convert")%>" />
    <%/if%>
    <!--/积分兑换-->
    
    <%else if {action}=="list"%>
    <!--积分明细-->
    <script type="text/javascript">
		function ExecPostBack(checkValue) {
			if (arguments.length == 1) {
				ExecDelete('{config.webpath}tools/submit_ajax.ashx?action=user_point_delete', checkValue, 'turl');
			}else{
				var valueArr = '';
				$("input[name='checkId']:checked").each(function(i){
					valueArr += $(this).val();
					if(i < $("input[name='checkId']:checked").length - 1){
						valueArr += ","
					}
				});
				ExecDelete('{config.webpath}tools/submit_ajax.ashx?action=user_point_delete', valueArr, 'turl');
			}
		}
	</script>
    <div class="tab_head">
      <ul class="tabs">
        <li><a href="<%linkurl("userpoint","convert")%>">积分兑换</a></li>
        <li class="selected"><a href="<%linkurl("userpoint","list")%>">积分明细</a></li>
      </ul>
    </div>
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="mtable">
      <%set (DataTable){list1}=get_user_point_list(10, page, "user_name='"+userModel.user_name+"'", out totalcount)%> <!--取得一个DataTable-->
      <%set (string){pagelist1}=get_page_link(10, page, totalcount, "userpoint1", action, "__id__")%> <!--取得分页页码列表-->
      <%loop dr list1%>
      <tr>
        <td width="20" align="center"><input name="checkId" class="checkall" type="checkbox" value="{dr[id]}" ></td>
        <td width="150">{dr[add_time]}</td>
        <td>{dr[remark]}</td>
        <td width="50">
          <%if {strtoint({dr[value]})}>0%>
          +{dr[value]}
          <%else%>
          {dr[value]}
          <%/if%>
        </td>
        <td width="35"><a onclick="ExecPostBack('{dr[id]}');" href="javascript:;">删除</a></td>
      </tr>
      <%/loop%>
      <%if totalcount<1%>
      <tr><td align="center">暂无记录</td></tr>
      <%/if%>
    </table>
    
    <div class="page_foot">
      <div class="flickr right">{pagelist1}</div><!--放置页码列表-->
      <div class="page_btns">
        <a onclick="checkAll(this);" href="javascript:;">全选</a>
        <span class="pipe">|</span>
        <a onclick="ExecPostBack();" href="javascript:;">删除</a>
      </div>
    </div>
    <input id="turl" type="hidden" value="<%linkurl("userpoint","list")%>" />
    <!--积分明细-->
    <%/if%>
    
  </div>
</div>

<div class="clear"></div>

<!--Footer-->
<%template src=/_footer.html/%>
<!--/Footer-->
</body>
</html>
